 
 <template>
  <div class="osd-edit-box">
    <el-dialog title=""
               v-loading="loading"
               class="login-dialog"
               :show-close="false"
               :close-on-click-modal="false"
               :close-on-press-escape="false"
               width="70%"
               :visible.sync="dialogFormVisible">
      <el-table :data="tableData"
                border
                highlight-current-row
                @current-change="handleCurrentChange"
                style="width: 100%">
        <el-table-column type="index"
                         width="50">
        </el-table-column>
        <el-table-column prop="numberPlate"
                         label="Tractor No"
                         width="200">
        </el-table-column>
        <el-table-column prop="tidNgenKey"
                         label="Short Key">
        </el-table-column>
      </el-table>
      <span slot="footer"
            class="dialog-footer">
        <el-button @click="dialogFormVisible = false">关 闭</el-button>
        <el-button type="primary"
                   @click="ok">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>

import {
  showErrorMsg,
  log
} from '@/utils/message'
export default {
  components: {},
  name: "ReturnReceipts",
  data () {
    return {
      loading: false,
      dialogFormVisible: false,
      currentRow: null,
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },
  created: function () {
    // this.$router.push({ path: "/card/index" })
    // this.$router.push('/pcc')

  },
  methods: {
    setForm (form) {
      this.$emit('setParentForm', form)
    },
    handleCurrentChange (val) {
      this.currentRow = val;
    },
    // ok
    ok () {
      if (!this.currentRow) {
        showErrorMsg('请选择车辆！')
        return
      }

      this.$emit('updateTractor', this.currentRow)
      this.close()
    },
    show (rows) {
      this.tableData = rows
      this.dialogFormVisible = true
    },
    close () {
      this.dialogFormVisible = false
    }
  },
}
</script>

<style scoped>
</style>
